.lux - BAStags - FLightR workflow

Install package

require(devtools)

install_github("SWotherspoon/SGAT")
install_github("SWotherspoon/BAStag")
install_github("eldarrak/FLightR") # note the version
library(BAStag)
library(FLightR)

Here I use FLightR after initial twilight detection by BAStag. First we start with downloading the .lux file .lux file into your working directory. I assume you will name it 'A2_raw_data.lux'. 2. open R and process .lux file

d.lux<-readMTlux("A2_raw_data.lux")
d.lux<- subset(d.lux,select=c("Date","Light"))

In the lux file light values go very high, so we should log transform data before selecting twilights.

d.lux$Light<-log(d.lux$Light)

now we plot the image and select offset

offset = 10
lightImage(d.lux, offset = offset, zlim = c(0, 12), dt = 300) # dt specifies the recording interval

threshold=1.5 # better use 1.5 for Intigeo tags if no strong reason for other value

twl <- preprocessLight(d.lux, threshold, offset = offset,lmax=12) # only needs to be done once

Transfer BAStag output to TAGS format...

library(FLightR)

TAGS.twilights<-BAStag2TAGS(d.lux, twl, threshold=1.5)

TAGS.twilights$light<-exp(TAGS.twilights$light) # this is needed only if you log transformed in the beginning..
save(TAGS.twilights, file="TAGS.twilights.RData")

Now you can read these data by FLightR.



eldarrak/FLightR documentation built on Nov. 10, 2023, 7:53 a.m.